package model;

import java.io.Serializable;
import java.util.Collection;

public class Macro extends CodeLine implements Cloneable, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2123668506959139732L;

	public Collection<Variable> getVariable() {
		return variable;
	}

	public void setVariable(Collection<Variable> variable) {
		this.variable = variable;
	}

	public Collection<CodeLine> codeLine;

	public Collection<Variable> variable;

	public Collection<CodeLine> getCodeLine() {
		return codeLine;
	}

	public void setCodeLine(Collection<CodeLine> codeLine) {
		this.codeLine = codeLine;
	}

	public CommandParameter getParameterForIndex(int index) {
		int i = 0;
		for (Variable var : getVariable()) {
			if (i++ == index) {
				return var;
			}
		}
		return null;
	}

	@Override
	public int getParameterCount() {
		return variable.size();
	}

}
